<template>
  <div class="easy-container">
    <div class="cell m-b-8">
      <router-link
        :to="`/spaces/${answer.space_id}/issues/${answer.issue_id}`"
        class="title f-normal hover-link"
      >{{ answer.issue_title }}</router-link>
    </div>
    <router-link :to="commentLink" v-html="$va.plainText(answer.content)" class="cell line2" />
    <div class="cell flex m-b-8 align-items-center">
      <timeago2 :date-time="answer.created_at" pre-text="回答于" class="info f-mini-plus" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'component-answers-list-item',
  props: {
    answer: Object,
  },
  computed: {
    commentLink() {
      return `/spaces/${this.answer.space_id}/issues/${this.answer.issue_id}?
          page=${parseInt(this.answer.floor / 10, 10) + 1}&comment_id=${this.answer.id}`;
    },
  },
};
</script>

<style></style>
